﻿namespace AiMoWindows.CodeScripts.Analysis
{
    class UsingFixLibrary
    {

        internal static readonly string[] separator = new string[] { "=", ":" };
        readonly HashSet<string> AlreadyUsings = new HashSet<string>();
        HashSet<string> KeyWords { get; } = new HashSet<string>();
        /// <summary>
        /// 输入已有的Usings，作为记录
        /// </summary>
        /// <param name="usingName"></param>
        public void SetDefaultUsing(string usingName)
        {
            AlreadyUsings.Add($"using {usingName};");
        }

        public void AddKeyword(string keyword)
        {
            KeyWords.Add(keyword);
        }
        public IEnumerable<string> GetResultUsings()
        {
            HashSet<string> newUsings = new HashSet<string>(AlreadyUsings);
            foreach (string keyWord in KeyWords.Where(x => KeyMethodsDict.ContainsKey(x)))
            {
                int usingIndex = KeyMethodsDict[keyWord];
                if (UsingsDict.TryGetValue(usingIndex, out string? value))
                {
                    string neededUsings = value;
                    newUsings.Add(neededUsings);
                }
            }
            return newUsings.OrderBy(x => x);
        }

        static readonly Dictionary<string, int> KeyMethodsDict = new Dictionary<string, int>();
        static readonly Dictionary<int, string> UsingsDict = new Dictionary<int, string>();
        public static bool Inited { get; private set; } = false;
        public static void Init()
        {
            if (Inited) return;
            UsingsDict.Clear();
            KeyMethodsDict.Clear();
            int currentIndex = -1;

            string errors = "";
            foreach (string line0 in DefaultUsingsDict)
            {
                string line = line0.Trim();
                if (string.IsNullOrWhiteSpace(line) || line.StartsWith("//")) continue;
                if (line.Contains("//")) line = line[..line.IndexOf("//")];
                if (line.StartsWith("<Index>"))
                {
                    string[] values = line.Split(separator, StringSplitOptions.RemoveEmptyEntries);
                    currentIndex = int.Parse(values[1]);
                    if (UsingsDict.ContainsKey(currentIndex))
                    {
                        throw new Exception($"Debug Error: UsingsDict has duplicated key {currentIndex}");
                    }
                    UsingsDict[currentIndex] = values[2].Trim();
                    continue;
                }
                if (!KeyMethodsDict.TryAdd(line, currentIndex))
                {
                    string dup = "NOT-FOUND";
                    if (KeyMethodsDict.TryGetValue(line, out int index0) && UsingsDict.TryGetValue(index0, out string? text0))
                    {
                        dup = text0;
                    }

                    string error = $"Debug Error: KeyMethodsDict has duplicated key {line} in {UsingsDict[currentIndex]} and {dup}\n";
                    errors += error;
                }
            }
            if (!string.IsNullOrEmpty(errors))
            {
                throw new Exception(errors);
            }
            Inited = true;
        }

        static string[] DefaultUsingsDict => new string[]
        {
            "//系统级别",
            "<Index> = 101: using System;",
            "Guid",
            "Math",
            "DateTime",
            "Array",
            "Random",
            "Environment",
            "BitConverter",
            "",

            "<Index> = 102: using System.Collections.Generic;",
            "HashSet",
            "List",
            "Dictionary",
            "SortedList",
            "KeyValuePair",
            "IEnumerable",
            "",

            "<Index> = 103: using System.Windows.Forms;",
            "MessageBox",
            "",

            "<Index> = 104: using System.Drawing;",
            "Color",
            "SystemColors",
            "Bitmap",
            "PointF",
            "RectangleF",
            "SizeF",
            "",

            "<Index> = 105: using System.Linq;",
            ".ToArray",
            ".Select",
            ".Where",
            ".OrderBy",
            ".OrderDescending",
            ".Contains",
            ".IndexOf",
            ".LastIndexOf",
            ".Skip",
            ".Take",
            ".Any",
            ".Reverse",
            ".TakeWhile",
            ".SkipWhile",
            ".FirstOrDefault",
            ".Last",
            ".LastOrDefault",
            "",

            "<Index> = 106: using System.IO;",
            "Path",
            "File",
            "Directory",
            "FileInfo",
            "DirectoryInfo",
            "",


            "<Index> = 107: using System.Text.RegularExpressions;",
            "Regex",
            "",

            "<Index> = 108: using System.Threading;",
            "Thread",
            "Timer",
            "ReaderWriterLock",
            "",

            "<Index> = 109: using System.Threading.Tasks;",
            "Task",
            "TaskFactory",
            "Parallel",
            "",

            "<Index> = 110: using System.Reflection;",
            "Assembly",
            "AssemblyName",
            "Module",
            "MemberInfo",
            "FieldInfo",
            "PropertyInfo",
            "ConstructorInfo",
            "EventInfo",
            "ParameterInfo",
            "CustomAttributeData",
            "MethodBase",
            "",


            "//Rhino级别",
            "<Index> = 201: using Rhino.DocObjects;",
            "GripObject",
            "Group",
            "HatchObject",
            "InstanceDefinition",
            "InstanceObject",
            "Layer",
            "LightObject",
            "Material",
            "ObjectAttributes",
            "ObjectColorSource",
            "ObjectMaterialSource",
            "ObjectMode",
            "ObjectType",
            "ObjRef",
            "RhinoObject",
            "TextHorizontalAlignment",
            "TextObject",
            "TextOrientation",
            "TextVerticalAlignment",
            "ViewInfo",
            "ViewportInfo",
            "",

            "<Index> = 202: using Rhino.DocObjects.Tables;",
            "LayerTable",
            "GroupTable",
            "InstanceDefinitionTable",
            "LightTable",
            "MaterialTable",
            "NamedViewTable",
            "ObjectTable",
            "",

            "<Index> = 203: using Rhino.Geometry;",
            "AnnotationBase",
            "AnnotationType",
            "Arc",
            "ArcCurve",
            "AreaMassProperties",
            "BezierCurve",
            "BezierSurface",
            "BoundingBox",
            "Box",
            "Brep",
            "BrepEdge",
            "BrepFace",
            "BrepLoop",
            "BrepTrim",
            "BrepVertex",
            "ComponentIndex",
            "Cone",
            "ControlPoint",
            "Curve",
            "CurveEnd",
            "CurveKnotStyle",
            "CurveOrientation",
            "Cylinder",
            "Dimension",
            "Extrusion",
            "GeometryBase",
            "Hatch",
            "InstanceDefinitionGeometry",
            "InstanceReferenceGeometry",
            "Interpolator",
            "Interval",
            "Light",
            "LightStyle",
            "Line",
            "LinearDimension",
            "LineCurve",
            "Matrix",
            "Mesh",
            "MeshFace",
            "MeshNgon",
            "MeshPoint",
            "NurbsCurve",
            "NurbsSurface",
            "Plane",
            "Point2d",
            "Point2f",
            "Point3d",
            "Point3f",
            "PointCloud",
            "PolyCurve",
            "Polyline",
            "PolylineCurve",
            "Quaternion",
            "Ray3d",
            "Rectangle3d",
            "Sphere",
            "SubD",
            "Surface",
            "TextDot",
            "TextEntity",
            "Transform",
            "TransformRigidType",
            "TransformSimilarityType",
            "Vector2d",
            "Vector2f",
            "Vector3d",
            "Vector3f",
            "",

            "<Index> = 204: using Rhino;",
            "RhinoDoc",
            "RhinoApp",
            "PersistentSettings",
            "IndexPair",
            "RhinoMath",
            "",

            "<Index> = 205: using Rhino.Display;",
            "DisplayPipeline",
            "RhinoViewport",
            "ViewCapture",
            "",

            "<Index> = 206: using Rhino.Input.Custom;",
            "GetPoint",
            "GetObject",
            "",

            "<Index> = 207: using Rhino.Input;",
            "GetResult",
            "RhinoGet",
            "",

            "<Index> = 208: using Rhino.Commands;",
            "Result",
            "Command",
            "RunMode",
            "",

            "<Index> = 209: using Rhino.Geometry.Collections;",
            "BrepCurveList",
            "BrepEdgeList",
            "BrepFaceList",
            "BrepLoopList",
            "BrepSurfaceList",
            "BrepTrimList",
            "BrepVertexList",
            "MeshFaceList",
            "MeshFaceNormalList",
            "MeshNgonList",
            "MeshTopologyEdgeList",
            "MeshTopologyVertexList",
            "MeshVertexColorList",
            "MeshVertexList",
            "MeshVertexNormalList",
            "NurbsCurveKnotList",
            "NurbsCurvePointList",
            "NurbsSurfaceKnotList",
            "NurbsSurfacePointList",
            "SubDEdgeList",
            "SubDFaceList",
            "SubDVertexList",
            "",

            "<Index> = 210: using Rhino.Geometry.Intersect;",
            "CurveIntersections",
            "Intersection",
            "IntersectionEvent",
            "LineSphereIntersection",
            "LineCircleIntersection",
            "LineCylinderIntersection",
            "MeshClash",
            "PlaneCircleIntersection",
            "PlaneSphereIntersection",
            "SphereSphereIntersection",
            "",

            "<Index> = 211: using Rhino.Render;",
            "RenderMaterial",
            "",

            "<Index> = 301: using Grasshopper;",
            "DataTree",
            "",

            "<Index> = 302: using Grasshopper.Kernel;",
            "GH_Alias",
            "GH_AttributesChangedEventArgs",
            "IGH_Author",
            "GH_Author",
            "GH_ComponentServer",
            "GH_DisplayExpiredEventArgs",
            "GH_DocumentContext",
            "GH_Document",
            "GH_DocumentRenderMeshProvider",
            "GH_Exposure",
            "GH_ExternalFileType",
            "GH_ExternalFile",
            "GH_DocumentTreeNode",
            "GH_DocumentTree",
            "GH_FileSystemEventServer",
            "GH_GHALoadingEventArgs",
            "GH_IconDisplayMode",
            "IGH_InstanceGuidDependent",
            "GH_LoadingDemand",
            "GH_LoadingMechanism",
            "GH_LoadingAttribute",
            "GH_LoadingException",
            "GH_ObjectChangedEventArgs",
            "GH_ObjectEventType",
            "GH_ObjectType",
            "IGH_ObjectProxy",
            "GH_CompiledObjectProxy",
            "GH_UserObjectProxy",
            "GH_GraphProxy",
            "GH_PingDocumentEventArgs",
            "GH_PreviewBoundary",
            "GH_PreviewExpiredEventArgs",
            "GH_DocumentAssociations",
            "GH_SolutionExpiredEventArgs",
            "IGH_DebugDescription",
            "GH_DebugDescriptionWriter",
            "IGH_TaskCapableComponent",
            "GH_TaskCapableComponent",
            "IGH_UpgradeObject",
            "GH_UpgradeUtil",
            "IGH_ZuiAction",
            "GH_ZuiAction",
            "IGH_UserPromptAware",
            "IGH_DocumentObject",
            "GH_LibraryLicense",
            "GH_AssemblyInfo",
            "GH_AssemblyInfoStub",
            "GH_LoadingInstruction",
            "GH_AssemblyPriority",
            "GH_AutoSaveTrigger",
            "GH_AutoSaveSettings",
            "GH_CaseInsensitiveStringComparer",
            "GH_ConnectivityNode",
            "GH_ConnectivityDiagram",
            "GH_ConnectivityDisparity",
            "IGH_ParamNameConstructor",
            "GH_CharPatternParamNameConstructor",
            "GH_StringPattern",
            "GH_IncrementalParamNameConstructor",
            "GH_DocSettingsEventArgs",
            "GH_DocEnabledEventArgs",
            "GH_DocContextEventArgs",
            "GH_DocModifiedEventArgs",
            "GH_DocObjectEventArgs",
            "GH_DocUndoEventArgs",
            "GH_DocFilePathEventArgs",
            "GH_SelectionTopology",
            "GH_SearchHit",
            "GH_RelevantObjectFilter",
            "GH_SolutionEventArgs",
            "GH_SolutionMode",
            "GH_SolutionSpan",
            "GH_ProcessStep",
            "GH_SelectionState",
            "GH_Arrange",
            "GH_Filter",
            "GH_DocumentSettings",
            "GH_UndoOperation",
            "GH_GHXHarvester",
            "GH_MarkovOutcome",
            "GH_MarkovPattern",
            "GH_MarkovChain",
            "GH_ObjectSpecies",
            "GH_PreviewUtil",
            "GH_ProfilerMode",
            "GH_DocumentRank",
            "GH_RelevantObjectData",
            "GH_ScriptComponentUtilities",
            "GH_Process",
            "GH_ProcessForm",
            "GH_StateTagLayoutDirection",
            "GH_StateTagList",
            "IGH_StateTag",
            "GH_StateTag",
            "GH_StateTag_Graft",
            "GH_StateTag_Invert",
            "GH_StateTag_Flatten",
            "GH_StateTag_Reverse",
            "GH_StateTag_Simplify",
            "GH_StateTag_Expression",
            "GH_StateTag_Reparameterize",
            "GH_StateTag_Unitize",
            "GH_StateTag_Degrees",
            "GH_StateTag_Synchronize",
            "GH_StateTag_Principal",
            "GH_MatchLevel",
            "GH_MatchWeight",
            "GH_StringMatcher",
            "GH_ParamServerEventArgs",
            "GH_ParamHashFields",
            "GH_ComponentParamServer",
            "GH_LineParserAction",
            "GH_LineParser",
            "GH_PersistentGeometryParam",
            "GH_GetterResult",
            "GH_PersistentParam",
            "GH_FileWatcherEvents",
            "GH_FileWatcher",
            "GH_ListUtil",
            "GH_BitmapChannel",
            "GH_MemoryBitmap",
            "GH_Component",
            "GH_State",
            "GH_StateServer",
            "GH_MathUtil",
            "GH_SolutionPhase",
            "GH_RuntimeMessageLevel",
            "IGH_ActiveObject",
            "GH_ActiveObject",
            "IGH_PreviewArgs",
            "GH_PreviewArgs",
            "GH_PreviewWireArgs",
            "GH_PreviewMeshArgs",
            "GH_RenderArgs",
            "IGH_PreviewObject",
            "IGH_PreviewData",
            "IGH_PreviewMeshData",
            "IGH_RenderAwareData",
            "IGH_RenderAwareObject",
            "GH_Convert",
            "GH_TimeKind",
            "GH_Conversion",
            "GH_Format",
            "GH_UserObject",
            "GH_GuidConflictSolution",
            "GH_NoiseTable",
            "GH_SettingsType",
            "GH_SettingsServer",
            "IGH_DataAccess",
            "GH_TypeLib",
            "GH_WireTopology",
            "GH_WireTopologyDiagram",
            "IGH_BakeAwareData",
            "IGH_BakeAwareObject",
            "GH_BakeUtility",
            "IGH_ScriptInstance",
            "GH_ScriptInstance",
            "IGH_StateAwareObject",
            "GH_ClipboardType",
            "GH_DocumentIO",
            "GH_DocumentProperties",
            "GH_Revision",
            "IGH_ValueProxy",
            "GH_ValueProxy",
            "IGH_ProxyParameter",
            "GH_DocumentObject",
            "IGH_InstanceDescription",
            "GH_InstanceDescription",
            "GH_PluginFolderType",
            "GH_AssemblyFolderInfo",
            "GH_DocumentServer",
            "IGH_DocumentOwner",
            "GH_GuidTable",
            "GH_DocumentEventServer",
            "IGH_EventConsumer",
            "GH_CustomEventServer",
            "GH_FontServer",
            "GH_PickBox",
            "IGH_Attributes",
            "GH_Attributes",
            "GH_DataComparison",
            "IGH_Component",
            "GH_PreviewMode",
            "GH_PreviewFilter",
            "GH_PreviewMesh",
            "GH_ParamWireDisplay",
            "GH_ParamData",
            "GH_ParamAccess",
            "GH_ParamKind",
            "GH_PrincipalState",
            "GH_DataMapping",
            "IGH_Param",
            "IGH_ParamWithPostProcess",
            "GH_ParameterContext",
            "IGH_ContextualParameter",
            "GH_Param",
            "GH_RuntimeMessage",
            "GH_VarParamSide",
            "GH_VarParamEventArgs",
            "IGH_VarParamComponent",
            "GH_ParameterSide",
            "IGH_VariableParameterComponent",
            "IGH_InitCodeAware",
            "GHAFileLoadedEventHandler",
            "GH_HookSortElement",
            "GH_ActiveObjectFilter",
            "GH_ScheduleDelegate",
            "GH_UndoUtil",
            "GH_Association",
            "IGH_SyncObject",
            "GH_SyncObject",
            "GH_ParamEnumerator",
            "GH_ParamManager",
            "GH_InputParamManager",
            "GH_OutputParamManager",
            "GH_StructureIterator",
            "GH_Day",
            "GH_Month",
            "GH_SingleSetting",
            "GH_SingleSettingNullProvider",
            "GH_SingleSettingBooleanProvider",
            "GH_SingleSettingByteProvider",
            "GH_SingleSettingIntegerProvider",
            "GH_SingleSettingDoubleProvider",
            "GH_SingleSettingStringProvider",
            "GH_SingleSettingColorProvider",
            "GH_SingleSettingDateProvider",
            "GH_SingleSettingPointProvider",
            "GH_SingleSettingSizeProvider",
            "GH_SingleSettingRectangleProvider",
            "GH_GuidCombo",
            "",

            "<Index> = 303: using Grasshopper.Kernel.Parameters;",
            "Param_Culture",
            "Param_LatLonLocation",
            "Param_Field",
            "Param_Matrix",
            "Param_Group",
            "Param_Transform",
            "Param_SubD",
            "GH_ExpressionUndoAction",
            "IGH_ExpressionParameter",
            "GH_ExpressionParam",
            "Param_MeshParameters",
            "Param_FilePath",
            "Param_RectangleAttributes",
            "Param_Rectangle",
            "Param_Guid",
            "GH_ReceiverAttributes",
            "GH_Receiver",
            "IGH_TypeHint",
            "Param_Arc",
            "Param_Box",
            "GH_ProxyParameterAttributes",
            "GH_ProxyParameter",
            "Param_PointAttributes",
            "Param_Point",
            "Param_Vector",
            "Param_Boolean",
            "Param_Brep",
            "Param_Circle",
            "Param_Colour",
            "Param_Curve",
            "Param_Number",
            "Param_Geometry",
            "Param_Integer",
            "Param_Line",
            "Param_Mesh",
            "Param_MeshFace",
            "Param_GenericObject",
            "Param_OGLShader",
            "Param_Interval2D_OBSOLETE",
            "Param_Interval2D",
            "Param_Interval",
            "Param_Plane",
            "Param_ScriptVariable",
            "Param_String",
            "Param_Surface",
            "Param_Time",
            "Param_StructurePath",
            "Param_Complex",
            "GH_WireAppearance",
            "GH_GeometryProxy",
            "",

            "<Index> = 304: using Grasshopper.Kernel.Special;",
            "GH_BooleanToggleAttributes",
            "GH_BooleanToggle",
            "GH_ButtonObjectAttributes",
            "GH_ButtonObject",
            "GH_ClusterHookAttributes",
            "GH_ClusterHook",
            "GH_ClusterInputHookAttributes",
            "GH_ClusterInputHook",
            "GH_ClusterOutputHookAttributes",
            "GH_ClusterOutputHook",
            "GH_Synchronisation",
            "GH_ClusterProtection",
            "GH_ClusterFileType",
            "GH_ClusterFile",
            "GH_ClusterAttributes",
            "GH_Cluster",
            "GH_ColourPickerAttributes",
            "GH_ColourPickerObject",
            "GH_ColourWheelStyle",
            "GH_ColourWheelGrip",
            "GH_ColourWheelState",
            "GH_ColourWheelAttributes",
            "GH_ColourWheel",
            "GH_DialKnobAttributes",
            "GH_DialKnob",
            "GH_DataRecorderRecordSettingUndoAction",
            "GH_DataRecorderAttributes",
            "GH_DataRecorder",
            "GH_GeometryPipelineAttributes",
            "GH_GeometryPipeline",
            "GH_GeometryCacheAttributes",
            "GH_GeometryCache",
            "GH_ItemPickerAttributes",
            "GH_ItemPicker",
            "GH_JumpObjectAttributes",
            "GH_JumpObject",
            "GH_RelayAttributes",
            "GH_Relay",
            "GH_SuireStyleNodeAttributes",
            "GH_SuireSimplifyNode",
            "GH_TextBalloonAttributes",
            "GH_TextBalloon",
            "GH_ValueListItem",
            "GH_ValueListMode",
            "GH_ValueListAttributes",
            "GH_ValueList",
            "GH_DigitScrollerAttributes",
            "GH_DigitScroller",
            "GH_ValueTimeline",
            "GH_ClusterAttributes_OBSOLETE",
            "GH_Cluster_OBSOLETE",
            "GH_ConstantObjectAttributes",
            "GH_ConstantObject",
            "GH_GroupBorder",
            "GH_GroupAttributes",
            "GH_Group",
            "GH_LegendAttributes",
            "GH_Legend",
            "GH_LegendType",
            "GH_LegendData",
            "GH_MultiDimensionalSliderAttributes",
            "GH_MDSliderMode",
            "GH_MultiDimensionalSlider",
            "GH_PathMapperAttributes",
            "GH_PathMapper",
            "GH_PieChartAttributes",
            "GH_PieChart",
            "GH_PieChartPair",
            "GH_PieChartDataSet",
            "GH_QuickGraphSortOrder",
            "GH_QuickGraphAttributes",
            "GH_QuickGraph",
            "GH_QuickGraphBundle",
            "GH_QuickGraphTrack",
            "GH_QuickGraphDot",
            "GH_QuickGraphFrame",
            "GH_ScribbleAttributes",
            "GH_Scribble",
            "GH_ImageSamplerAttributes",
            "GH_SamplingFilter",
            "GH_ImageSampler",
            "GH_PanelAttributes",
            "GH_Panel",
            "GH_PanelProperties",
            "GH_BarGraphAttributes",
            "GH_BarGraph",
            "GH_BooleanSwitchAttributesObsolete",
            "GH_BooleanSwitch_Obsolete",
            "GH_ColourSwatchAttributes",
            "GH_ColourSwatch",
            "GH_TimerAttributes",
            "GH_Timer",
            "GH_NumberSliderAttributes",
            "GH_NumberSlider",
            "GH_ValueTrackerAttributes",
            "GH_ValueTracker",
            "GH_GradientControlAttributes",
            "GH_GradientControl",
            "GH_GraphMapperAttributes",
            "GH_GraphMapper",
            "GH_ParamViewerAttributes",
            "GH_ParamViewer",
            "GH_MarkupDashPattern",
            "GH_MarkupProperties",
            "GH_MarkupAttributes",
            "GH_Markup",
            "GH_MarkupCollection",
            "GH_PolylineReductionSetManager",
            "GH_SliderAnimator",
            "GH_BooleanTogglePublishProxy",
            "GH_ButtonPublishProxy",
            "HookParamMap",
            "ParamGuidComparer",
            "GH_ClusterPasswordUndoAction",
            "GH_ClusterPropertiesUndoAction",
            "GH_ClusterPreviewDocumentAction",
            "GH_ClusterDocumentIdAction",
            "GH_ClusterReferenceAction",
            "GH_2DLayout",
            "GH_3DLayout",
            "GH_PieChartDisplayData",
            "GH_DragMode",
            "GH_PanelPublishProxy",
            "GH_BarData",
            "GH_ColourSwatchPublishProxy",
            "GH_TimerTargetInteraction",
            "GH_NumberSliderPublishProxy",
            "GH_PanelMouseOperation",
            "GH_ParamPathEntry",
            "",

            "<Index> = 305: using Grasshopper.Kernel.Types;",
            "GH_DifferentialSolver",
            "GH_Field",
            "IGH_FieldElement",
            "GH_FieldElement",
            "GH_PointCharge",
            "GH_LineCharge",
            "GH_VectorForce",
            "GH_SpinForce",
            "GH_Culture",
            "GH_LonLatCoordinate",
            "GH_Matrix",
            "GH_SubD",
            "GH_GeometryGroup",
            "GH_Transform",
            "GH_Arc",
            "GH_Boolean",
            "GH_Box",
            "GH_Brep",
            "GH_Circle",
            "GH_Colour",
            "GH_ComplexNumber",
            "GH_Curve",
            "GH_Guid",
            "GH_Integer",
            "GH_Interval",
            "GH_Interval2D",
            "GH_Line",
            "GH_MeshingParameters",
            "GH_Rectangle",
            "GH_Mesh",
            "GH_MeshFace",
            "GH_Number",
            "GH_Plane",
            "GH_Material",
            "GH_String",
            "IGH_GeometricGoo",
            "GH_GeometricGoo",
            "GH_GeometricGooWrapper",
            "IGH_GeometricGooWithObjRef",
            "IGH_GooProxy",
            "GH_GooProxy",
            "GH_PointUtil",
            "GH_StructurePath",
            "GH_Surface",
            "GH_Time",
            "GH_Point",
            "GH_Vector",
            "GH_WrapperType",
            "GH_ObjectWrapper",
            "GH_PointRefType",
            "GH_PointRefData",
            "IGH_Goo",
            "GH_Goo",
            "GH_QuickCastType",
            "IGH_QuickCast",
            "GH_Proxy",
            "GH_GeometryGroupProxy",
            "GH_BoxProxy",
            "GH_BrepProxy",
            "GH_CircleProxy",
            "GH_CurveProxy",
            "GH_Interval2DProxy",
            "GH_LineProxy",
            "GH_RectangleProxy",
            "GH_MeshProxy",
            "GH_MeshFaceProxy",
            "GH_PlaneProxy",
            "GH_Material_Proxy",
            "GH_GeometricGooProxy",
            "GH_SurfaceProxy",
            "GH_PointProxy",
            "GH_VectorProxy",
            "GH_GenericProxy",
            "",

            "<Index> = 306: using Grasshopper.Kernel.Undo;",
            "GH_UndoRecord",
            "GH_UndoServer",
            "GH_UndoException",
            "GH_UndoState",
            "IGH_UndoAction",
            "GH_UndoAction",
            "GH_ObjectUndoAction",
            "GH_ArchivedUndoAction",
            "",

            "<Index> = 307: using Grasshopper.Kernel.Utility;",
            "GH_Point3dWrapperDelegate",
            "GH_Point3d_Wrapper",
            "GH_Point3d_Wrapper_TypeConverter",
            "GH_Vector3dWrapperDelegate",
            "GH_Vector3d_Wrapper",
            "GH_Vector3d_Wrapper_TypeConverter",
            "GH_IntervalWrapperDelegate",
            "GH_Interval_Wrapper",
            "GH_Interval_Wrapper_TypeConverter",
            "GH_PointRefUVWrapperDelegate",
            "GH_PointRefUV_Wrapper",
            "GH_PointRefUV_Wrapper_TypeConverter",
            "GH_PlaneModifier",
            "",

            "<Index> = 308: using Grasshopper.Kernel.Attributes;",
            "GH_ResizableAttributes",
            "GH_ComponentAttributes",
            "GH_FloatingParamAttributes",
            "GH_LinkedParamAttributes",
            "InsertParamRegion",
            "RemoveParamRegion",
            "",

            "<Index> = 309: using Grasshopper.Kernel.Components;",
            "GH_PlaceholderInputAttributes",
            "GH_PlaceholderOutputAttributes",
            "GH_PlaceholderFloatingAttributes",
            "GH_PlaceholderComponentAttributes",
            "IGH_PlaceholderObject",
            "GH_PlaceholderParameter",
            "GH_PlaceholderComponent",
            "GH_DocExampleComponent",
            "GH_MetaBallComponent",
            "GH_MetaBallComponentThreshold",
            "GH_MetaBallComponentThresholdEx",
            "GH_GrasshopperLibraryInfo",
            "GH_CleanTreeComponent_OBSOLETE",
            "GH_CleanTreeComponent_OSBOLETE_AS_WELL",
            "GH_CleanComponentUpgrader",
            "GH_CleanTreeComponent",
            "GH_IsNullDataComponent_OBSOLETE",
            "GH_PruneTreeComponent",
            "GH_GraftTreeComponent_OBSOLETE",
            "GH_GraftTreeComponent",
            "GH_SimplifyTreeComponent_OBSOLETE",
            "GH_SimplifyTreeComponent",
            "GH_SimplifyComponentUpgrader",
            "GH_FlattenTreeComponent_OBSOLETE",
            "GH_FlattenTreeComponent",
            "GH_FlattenComponentUpgrader",
            "GH_UnflattenTreeComponent",
            "GH_TrimTreeComponent",
            "GH_MatchTreeComponent",
            "GH_ReplacePathComponent",
            "GH_ExplodeTreeComponent_OBSOLETE",
            "GH_ExplodeTreeComponent",
            "GH_UpgradeExplodeComponent",
            "GH_FlipDataMatrixComponent",
            "GH_ShiftDataPathComponent",
            "GH_GroupGeometryComponent",
            "GH_UngroupGeometryComponent",
            "GH_MergeGroupComponent",
            "GH_SplitGroupComponent",
            "GH_DataDamAttributes",
            "GH_DataDamComponent",
            "GH_SmoothNumbersComponent",
            "GH_ReadFileComponentAttributes",
            "GH_ReadFileComponent",
            "GH_PathCompareComponent",
            "GH_TreeSplitComponent",
            "GH_StreamFilterComponent_OBSOLETE",
            "GH_StreamFilterComponent",
            "GH_StreamGateComponent_OBSOLETE",
            "GH_StreamGateComponent",
            "GH_CustomPreviewComponent",
            "GH_CustomPreviewItem",
            "GH_CurvatureGraphComponent",
            "GH_PointListComponent",
            "GH_TextTag3DComponent_OBSOLETE",
            "GH_TextTag3DComponent_OBSOLETE_AS_WELL",
            "GH_TextTag3DComponent",
            "GH_TextTag3DUpgrader",
            "GH_TextTagComponent_OBSOLETE",
            "GH_TextTagComponent",
            "GH_ParserCode",
            "GH_CurvatureGraph",
            "GH_PointList",
            "GH_TextTag",
            "",

            "<Index> = 310: using Grasshopper.Kernel.Data;",
            "GH_IndexRange",
            "GH_IndexRanges",
            "GH_TreeIndex",
            "GH_RuleResult",
            "IGH_IndexRule",
            "GH_IndexRuleType",
            "GH_IndexRule",
            "GH_IndexRuleSet",
            "GH_TreeFilter",
            "GH_BracketMismatchException",
            "GH_StringMismatchException",
            "GH_RuleKind",
            "GH_RuleOperator",
            "IGH_Rule",
            "GH_RuleAnyNumbers",
            "GH_RuleAnyNumber",
            "GH_RuleNumber",
            "GH_RuleGroup",
            "GH_RuleRange",
            "GH_RuleSequence",
            "GH_RuleComplex",
            "GH_TreeRules",
            "IGH_DataTree",
            "GH_DirtyCaster",
            "GH_Path",
            "GH_Lexer",
            "GH_LexerCombo",
            "GH_PathOffset",
            "GH_GraphicBranch",
            "GH_GraphicTreeDisplayArgs",
            "GH_TreeBuilder",
            "IGH_StructureEnumerator",
            "GH_SimplificationMode",
            "GH_ExpandMode",
            "GH_GraftMode",
            "IGH_Structure",
            "GH_TypeCache",
            "GH_Structure",
            "GH_NonNullEnumerator",
            "GH_DataStructureEnumerator",
            "GH_GooStructureEnumerator",
            "",

            "<Index> = 311: using Grasshopper.Kernel.Expressions;",
            "GH_CodeString",
            "GH_CodeStringSegment",
            "GH_ExpressionParser",
            "GH_CharType",
            "GH_ExpressionString",
            "GH_ExpressionSyntaxWriter",
            "GH_ScriptVariantType",
            "GH_ScriptVariant",
            "GH_OperatorType",
            "GH_ParserOperator",
            "GH_ParserPrecedence",
            "GH_ParserTokenClass",
            "GH_ParserSymbol",
            "GH_VariantType",
            "GH_Variant",
            "GH_SyntaxException",
            "GH_SolverException",
            "GH_SignatureException",
            "IGH_ParserFunction",
            "GH_ParserFunction",
            "GH_SymbolRange",
            "GH_SolverContinuation",
            "",

            "<Index> = 312: using Grasshopper.Kernel.Geometry;",
            "GH_CurveOffsetCorner",
            "GH_SegmentType",
            "GH_Segment",
            "GH_SegmentCurve",
            "GH_CurveOffset",
            "GH_SanityXForm",
            "",

            "<Index> = 313: using Grasshopper.GUI;",
            "GH_AsynchFileData",
            "GH_AutoSaveLastChanceForm",
            "GH_FileRecoveryAction",
            "GH_EtoUtil",
            "GH_WindowsFormUtil",
            "GH_PruderyFilter",
            "GH_ClusterPasswordWindow",
            "GH_ColourPicker",
            "GH_ColourSwatchControl",
            "GH_ColourSwatchEventArgs",
            "GH_ComponentAggregateForm",
            "GH_ComponentInfoForm",
            "GH_MarkerType",
            "GH_ControlKnobOptionsForm",
            "GH_ControlKnobValueEditor",
            "GH_CustomButtonRunCode",
            "GH_CustomButtonRequireFilter",
            "GH_CustomButton",
            "GH_DataTreeGraphic",
            "GH_DataTreeBranchGraphic",
            "GH_DebugLogForm",
            "GH_ExternalFileConflictDialog",
            "GH_ExternalFilePanel",
            "GH_FontControl",
            "GH_FontList",
            "GH_FontPicker",
            "GH_FontScroller",
            "GH_GeometricFont",
            "GH_GooProxyList",
            "GH_LoadProtectDialog",
            "GH_MenuCustomControl",
            "GH_MenuShortcut",
            "GH_MeshingParametersFrontEnd",
            "GH_MeshingParametersEventArgs",
            "GH_MessageMustReadWindow",
            "GH_NamedViewMenuItem",
            "GH_NumberSliderSnappingEditor",
            "GH_PanelEditorControl",
            "GH_PasswordBox",
            "GH_QuickImageEditor",
            "GH_DragDropImageRenderer",
            "GH_ParamViewerForm",
            "GH_AnimatedProcessPanel",
            "GH_RibbonLayoutEditor",
            "GH_RibbonLayoutEditorUndoRedoEventArgs",
            "GH_RibbonLayoutEditorDialog",
            "GH_RotationalFrame",
            "GH_RotationalTuningData",
            "GH_SamplingSphere",
            "GH_SettingsGUI",
            "IGH_SettingCategory",
            "GH_SettingsCategory",
            "IGH_SettingFrontend",
            "GH_DisplaySettingsCategory",
            "GH_SolverSettingsCategory",
            "GH_AuthorSettingsCategory",
            "GH_ViewportSettingsCategory",
            "GH_InterfaceSettingsCategory",
            "GH_FontsSettingsCategory",
            "GH_PaletteSettingsCategory",
            "GH_WidgetsSettingsCategory",
            "GH_FilesSettingsCategory",
            "GH_RibbonSettingsUI",
            "GH_FormattingSettingsUI",
            "GH_DefaultPreviewSettingsUI",
            "GH_DocumentPreviewSettingsUI",
            "GH_GumballAndMeshingSettingsUI",
            "GH_TemplatePathSettingsUI",
            "GH_SolverSettingsUI",
            "GH_GHALoadSettingsUI",
            "GH_AuthorSettingsUI",
            "GH_AutoSaveSettingsUI",
            "GH_MRUSettingsUI",
            "GH_CanvasOverlaySettingsUI",
            "GH_CanvasZuiSettingsUI",
            "GH_TooltipWiggleSettingsUI",
            "GH_FontStandardSettingsUI",
            "GH_FontScriptSettingsUI",
            "GH_FontConsoleSettingsUI",
            "GH_PruderySettingsUI",
            "GH_ComponentMenuSettingsUI",
            "GH_MenuShortcutSettingsUI",
            "GH_AlignWidgetSettingsUI",
            "GH_MarkovWidgetSettingsUI",
            "GH_ProfilerWidgetSettingsUI",
            "GH_CompassWidgetSettingsUI",
            "GH_MessagesWidgetSettingsUI",
            "GH_CapsuleStandardPaletteSettingsUI",
            "GH_CapsuleHiddenPaletteSettingsUI",
            "GH_CapsuleDisabledPaletteSettingsUI",
            "GH_CapsuleWarningPaletteSettingsUI",
            "GH_CapsuleErrorPaletteSettingsUI",
            "GH_StandardIcons",
            "GH_TextInputBaseControl",
            "GH_UnrecognizedObjectsForm",
            "GH_UpgradeComponentControl",
            "GH_UpgradeComponentForm",
            "GH_UpgradeUndoWarningDialog",
            "GH_NumberPresets",
            "GH_SettingsServerBrowser",
            "GH_Slider",
            "GH_UndoServerBrowser",
            "GH_ValueListEditor",
            "GH_ToolstripItemKeyHandlerResult",
            "IGH_ToolstripItemKeyHandler",
            "GH_VersionHistoryRelease",
            "GH_VoronoiWarningForm",
            "GH_WndProcOverridenCodeEditor",
            "GH_FadePhase",
            "GH_FadeAnimation",
            "GH_Interpolation",
            "GH_AnimationPhase",
            "GH_Animator",
            "GH_AssemblyInfoDialog",
            "GH_ClusterGateWayProperties",
            "GH_ClusterPropertiesEditor",
            "GH_BezierSolver",
            "GH_DocumentMdiItem",
            "GH_DocumentPreviewSettings",
            "GH_PreviewSettingsChangedEventArgs",
            "GH_FontMappingDialog",
            "GH_SeparatorDisplay",
            "GH_HorizontalSeparator",
            "GH_VerticalSeparator",
            "GH_IconLabel",
            "GH_IconPicker",
            "GH_IconVariations",
            "GH_Constraint",
            "GH_DragInfo",
            "GH_FindObjectDialog",
            "GH_FormShepard",
            "GH_GDI_Util",
            "GH_GradientMenuItem",
            "GH_HiResExportForm",
            "GH_IconTable",
            "GH_KernelAssemblyCopyLocalWarning",
            "GH_LexerComboEditor",
            "GH_LexerMaskEditor",
            "GH_LoadingError",
            "GH_LoadingExceptionBrowser",
            "GH_MaterialPreview",
            "GH_MaterialPreviewControl",
            "GH_MenuStrip",
            "GH_MeshingParameterDialog",
            "GH_PageCurl",
            "GH_PreviewPreset",
            "GH_MDSliderDialog",
            "GH_TrackerFrame",
            "GH_MouseTracker",
            "GH_MultiDocSave",
            "GH_MultiSaveDocumentEntry",
            "GH_PingMessageWindow",
            "GH_ScribblePropertiesDialog",
            "GH_VerticalScrollBar",
            "GH_RhAttributesEditor",
            "GH_CreateStateDialog",
            "GH_DocumentEditor",
            "GH_MenuShortcutEventArgs",
            "GH_ImageSamplerSettingsDialog",
            "GH_NickNameTextBox",
            "GH_SourceCodeBlock",
            "GH_SourceCodeLine",
            "GH_SourceCodeLines",
            "GH_SourceCodeEditor",
            "GH_GDI_PolyArc",
            "GH_ObjectExceptionDialog",
            "GH_StateObjectFrontEnd",
            "GH_NumericScrollerValueEditor",
            "GH_InfoTextBox",
            "GH_InfoTextBoxEventArgs",
            "GH_ArrowControl",
            "GH_ASSERT_DIALOG",
            "GH_ComponentGuidConflictDialog",
            "GH_Toolstrip",
            "GH_Tooltip",
            "GH_TooltipDisplayEventArgs",
            "GH_TooltipComponent",
            "GH_ToolTipForm",
            "IGH_Tooltip",
            "GH_TooltipPalette",
            "GH_DateTimePicker",
            "GH_DeveloperSettings",
            "GH_DoubleBufferedPanel",
            "GH_NumberSliderPopup",
            "GH_ExpressionEditor",
            "GH_FolderPathBrowser",
            "GH_UserObjectDeleteConfirmationDialog",
            "GH_UserObjectProperties",
            "GH_VariableParameterManager",
            "GH_VersionHistoryForm",
            "GH_GradientEditor",
            "GH_GraphEditor",
            "GH_GraphicsUtil",
            "GH_Interval2DPicker",
            "GH_Label",
            "GH_ListScroller",
            "GH_ListScrollerChangedEventArgs",
            "GH_NumericTextBox",
            "GH_PointCurveParamEditor",
            "GH_ProgressBar",
            "GH_VariableParamProxy",
            "GH_MarkupAttributesDialog",
            "GH_MenuTextBox",
            "GH_MultilineGooEditor",
            "GH_PanelEditor",
            "GH_ParserFunctionViewer",
            "GH_RemoteSliderControl",
            "GH_RemoteSwitchControl",
            "GH_RevisionEditor",
            "GH_Slider_Obsolete",
            "GH_SliderInputMode",
            "GH_SliderAnimationSetup",
            "GH_TextRenderingConstants",
            "GH_UndoRecordBrowser",
            "GH_WindowsControlUtil",
            "IGH_Embeddable",
            "IGH_FileDropTarget",
            "GH_DocumentPropertiesEditor",
            "GH_ParseAssemblyProgressDialog",
            "GH_Splitter",
            "IGH_FixedSizeControl",
            "GH_CursorServer",
            "GH_MenuShortCutWrapper",
            "GH_Banner",
            "GH_BannerIconGrid",
            "GH_PersistentDataEditor",
            "GH_CanvasMouseEvent",
            "GH_CanvasObjectMouseDownEventArgs",
            "GH_YakDownloadFormEto",
            "GH_LimitedNumber",
            "GH_KernEntry",
            "GH_KernTable",
            "MeshingParametersChangedEventHandler",
            "GH_PaintDelegate",
            "GH_Relation",
            "GH_FormAlignment",
            "GH_Node",
            "GH_PreviewExpression",
            "GH_ListItem",
            "GH_DragPhase",
            "GH_Scroll_Method",
            "GH_ValueChangedEventArgs",
            "GH_ScrollMouseRelation",
            "",

            "<Index> = 314: using Grasshopper.GUI.Canvas;",
            "GH_CanvasDocumentChangedEventArgs",
            "GH_CanvasMenuStrip",
            "GH_CanvasMode",
            "GH_CanvasNavigation",
            "IGH_CanvasValidator",
            "GH_CanvasValidator",
            "GH_CanvasValidatorCollection",
            "GH_CanvasDropTargetValidator",
            "GH_CanvasWireValidator",
            "GH_CanvasViewportChangedEventArgs",
            "GH_CanvasWidgetListEventArgs",
            "GH_DragDropFileAction",
            "GH_FilePanel",
            "GH_AutoPan",
            "GH_DragDropPainter",
            "GH_NamedViewType",
            "GH_NamedView",
            "GH_Palette",
            "GH_PaletteStyle",
            "GH_Skin",
            "GH_DocDiagramPainter",
            "GH_NavigationPaneDialog",
            "GH_BorderTopology",
            "GH_Border",
            "GH_ResizeBorder",
            "GH_PopupSearchDialog",
            "GH_NamedViewEditor",
            "GH_Orientation",
            "GH_Capsule",
            "GH_CapsuleRenderEngine",
            "IGH_TooltipAwareObject",
            "GH_Viewport",
            "GH_Canvas",
            "GH_ObjectResponse",
            "IGH_ResponsiveObject",
            "GH_CanvasChannel",
            "GH_WireType",
            "GH_WireDirection",
            "GH_Painter",
            "GH_Hit",
            "GH_DisplayMatrix",
            "GH_ImageSettings",
            "",

        };

    }
}
